package com.street.mapper;

import com.street.entity.Shop;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ShopMapper {
    @Select("select id, name, image, info, status, scope, phone, create_time,address from shops order by status desc ")
    List<Shop> selectShop();

    @Select("select id, name, image, info, status, scope, phone,address,create_time from shops where id=#{shopId}")
    Shop selectByShopId(Long shopId);

    @Update("update shops set name=#{name},image=#{image},info=#{info},phone=#{phone},address=#{address} where id=#{id}")
    void updateShop(Shop shop);

    @Update("update shops set status=#{status} where id=#{shopId}")
    void changeStatus(Integer status, Integer shopId);
}
